Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Inside–outside algorithm</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Inside%E2%80%93outside_algorithm"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Inside–outside_algorithm rootpage-Inside–outside_algorithm skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Inside–outside algorithm</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>For <a href="Parsing" title="Parsing">parsing algorithms</a> in <a href="Computer_science" title="Computer science">computer science</a>, the <b>inside–outside algorithm</b> is a way of re-estimating production probabilities in a <a href="Probabilistic_context-free_grammar" title="Probabilistic context-free grammar">probabilistic context-free grammar</a>. It was introduced by <a href="James_K._Baker" title="James K. Baker">James K. Baker</a> in 1979 as a generalization of the <a href="Forward%E2%80%93backward_algorithm" title="Forward–backward algorithm">forward–backward algorithm</a> for parameter estimation on <a href="Hidden_Markov_model" title="Hidden Markov model">hidden Markov models</a> to <a href="Stochastic_context-free_grammar" class="mw-redirect" title="Stochastic context-free grammar">stochastic context-free grammars</a>. It is used to compute expectations, for example as part of the <a href="Expectation%E2%80%93maximization_algorithm" title="Expectation–maximization algorithm">expectation–maximization algorithm</a> (an unsupervised learning algorithm).
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Inside_and_outside_probabilities">Inside and outside probabilities</h2></div>
<p>The inside probability <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \beta _{j}(p,q)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \beta _{j}(p,q)}</annotation>
</semantics>
</math></span><img src="./1043e40a720793af4ae515a917ec24ad8d39f3da.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:7.308ex; height:3.009ex;" alt="{\displaystyle \beta _{j}(p,q)}" loading="lazy"></span> is the total probability of generating words <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w_{p}\cdots w_{q}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
</mrow>
</msub>
<mo>⋯<!-- ⋯ --></mo>
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>q</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle w_{p}\cdots w_{q}}</annotation>
</semantics>
</math></span><img src="./20e885c62b40d30a21251632af0139f5a592a9b1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:8.873ex; height:2.343ex;" alt="{\displaystyle w_{p}\cdots w_{q}}" loading="lazy"></span>, given the root nonterminal <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N^{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N^{j}}</annotation>
</semantics>
</math></span><img src="./068824b74504ff9b8ea4c165569ef533333a3ce6.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:3.033ex; height:2.676ex;" alt="{\displaystyle N^{j}}" loading="lazy"></span> and a grammar <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>G</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle G}</annotation>
</semantics>
</math></span><img src="./f5f3c8921a3b352de45446a6789b104458c9f90b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.827ex; height:2.176ex;" alt="{\displaystyle G}" loading="lazy"></span>:<sup id="cite_ref-manning-schuetze1999_1-0" class="reference"><a href="#cite_note-manning-schuetze1999-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \beta _{j}(p,q)=P(w_{pq}|N_{pq}^{j},G)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
<mi>q</mi>
</mrow>
</msub>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<msubsup>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
<mi>q</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msubsup>
<mo>,</mo>
<mi>G</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \beta _{j}(p,q)=P(w_{pq}|N_{pq}^{j},G)}</annotation>
</semantics>
</math></span><img src="./8362cd071806c8e9d5b062a91ec5b86fed50bf0f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:24.63ex; height:3.509ex;" alt="{\displaystyle \beta _{j}(p,q)=P(w_{pq}|N_{pq}^{j},G)}" loading="lazy"></span></dd></dl>
<p>The outside probability <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha _{j}(p,q)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \alpha _{j}(p,q)}</annotation>
</semantics>
</math></span><img src="./691631b5f3d1213851f634b4d1b714bfae0cba2a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:7.48ex; height:3.009ex;" alt="{\displaystyle \alpha _{j}(p,q)}" loading="lazy"></span> is the total probability of beginning with the start symbol <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N^{1}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N^{1}}</annotation>
</semantics>
</math></span><img src="./1baf612daa302f8ba3c3467d2a1263aa32c5b260.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:3.177ex; height:2.676ex;" alt="{\displaystyle N^{1}}" loading="lazy"></span> and generating the nonterminal <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N_{pq}^{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
<mi>q</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msubsup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N_{pq}^{j}}</annotation>
</semantics>
</math></span><img src="./29a02373ab02474c14e53e757a3d482c17c2f0c7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:3.682ex; height:3.509ex;" alt="{\displaystyle N_{pq}^{j}}" loading="lazy"></span> and all the words outside <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w_{p}\cdots w_{q}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
</mrow>
</msub>
<mo>⋯<!-- ⋯ --></mo>
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>q</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle w_{p}\cdots w_{q}}</annotation>
</semantics>
</math></span><img src="./20e885c62b40d30a21251632af0139f5a592a9b1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:8.873ex; height:2.343ex;" alt="{\displaystyle w_{p}\cdots w_{q}}" loading="lazy"></span>, given a grammar <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>G</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle G}</annotation>
</semantics>
</math></span><img src="./f5f3c8921a3b352de45446a6789b104458c9f90b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.827ex; height:2.176ex;" alt="{\displaystyle G}" loading="lazy"></span>:<sup id="cite_ref-manning-schuetze1999_1-1" class="reference"><a href="#cite_note-manning-schuetze1999-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha _{j}(p,q)=P(w_{1(p-1)},N_{pq}^{j},w_{(q+1)m}|G)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mrow>
</msub>
<mo>,</mo>
<msubsup>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
<mi>q</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msubsup>
<mo>,</mo>
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">(</mo>
<mi>q</mi>
<mo>+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mi>m</mi>
</mrow>
</msub>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>G</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \alpha _{j}(p,q)=P(w_{1(p-1)},N_{pq}^{j},w_{(q+1)m}|G)}</annotation>
</semantics>
</math></span><img src="./46a54a47b0dc2d2508b18ad5f2a2db4082ddd00a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:36.756ex; height:3.676ex;" alt="{\displaystyle \alpha _{j}(p,q)=P(w_{1(p-1)},N_{pq}^{j},w_{(q+1)m}|G)}" loading="lazy"></span></dd></dl>
<div class="mw-heading mw-heading2"><h2 id="Computing_inside_probabilities">Computing inside probabilities</h2></div>
<p>Base Case:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \beta _{j}(p,p)=P(w_{p}|N^{j},G)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>p</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
</mrow>
</msub>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<msup>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msup>
<mo>,</mo>
<mi>G</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \beta _{j}(p,p)=P(w_{p}|N^{j},G)}</annotation>
</semantics>
</math></span><img src="./50815e2b99d693623179f2bb4a1d6b5254db8697.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:23.324ex; height:3.343ex;" alt="{\displaystyle \beta _{j}(p,p)=P(w_{p}|N^{j},G)}" loading="lazy"></span>
</p><p>General case:
</p><p>Suppose there is a rule <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N_{j}\rightarrow N_{r}N_{s}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N_{j}\rightarrow N_{r}N_{s}}</annotation>
</semantics>
</math></span><img src="./787afe945d132ef552d8bb88e9f93267ffdd51c6.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:12.099ex; height:2.843ex;" alt="{\displaystyle N_{j}\rightarrow N_{r}N_{s}}" loading="lazy"></span> in the grammar, then the probability of generating <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w_{p}\cdots w_{q}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>p</mi>
</mrow>
</msub>
<mo>⋯<!-- ⋯ --></mo>
<msub>
<mi>w</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>q</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle w_{p}\cdots w_{q}}</annotation>
</semantics>
</math></span><img src="./20e885c62b40d30a21251632af0139f5a592a9b1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:8.873ex; height:2.343ex;" alt="{\displaystyle w_{p}\cdots w_{q}}" loading="lazy"></span> starting with a subtree rooted at <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N_{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N_{j}}</annotation>
</semantics>
</math></span><img src="./e42efe207e17a74b4c17b1aa0cced7a84501bec9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:2.776ex; height:2.843ex;" alt="{\displaystyle N_{j}}" loading="lazy"></span> is:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{k=p}^{k=q-1}P(N_{j}\rightarrow N_{r}N_{s})\beta _{r}(p,k)\beta _{s}(k+1,q)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>p</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>q</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</munderover>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">)</mo>
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>k</mi>
<mo stretchy="false">)</mo>
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>k</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sum _{k=p}^{k=q-1}P(N_{j}\rightarrow N_{r}N_{s})\beta _{r}(p,k)\beta _{s}(k+1,q)}</annotation>
</semantics>
</math></span><img src="./3c96025defc36194aaa1e5db53665512a6a10308.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:39.992ex; height:7.676ex;" alt="{\displaystyle \sum _{k=p}^{k=q-1}P(N_{j}\rightarrow N_{r}N_{s})\beta _{r}(p,k)\beta _{s}(k+1,q)}" loading="lazy"></span>
</p><p>The inside probability <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \beta _{j}(p,q)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \beta _{j}(p,q)}</annotation>
</semantics>
</math></span><img src="./1043e40a720793af4ae515a917ec24ad8d39f3da.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:7.308ex; height:3.009ex;" alt="{\displaystyle \beta _{j}(p,q)}" loading="lazy"></span> is just the sum over all such possible rules:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \beta _{j}(p,q)=\sum _{N_{r},N_{s}}\sum _{k=p}^{k=q-1}P(N_{j}\rightarrow N_{r}N_{s})\beta _{r}(p,k)\beta _{s}(k+1,q)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
</mrow>
</munder>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>p</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>q</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</munderover>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">)</mo>
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>k</mi>
<mo stretchy="false">)</mo>
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>k</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \beta _{j}(p,q)=\sum _{N_{r},N_{s}}\sum _{k=p}^{k=q-1}P(N_{j}\rightarrow N_{r}N_{s})\beta _{r}(p,k)\beta _{s}(k+1,q)}</annotation>
</semantics>
</math></span><img src="./bbbbf3f985ecea0504eaff28fd6fa90c059ded2a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:55.439ex; height:7.676ex;" alt="{\displaystyle \beta _{j}(p,q)=\sum _{N_{r},N_{s}}\sum _{k=p}^{k=q-1}P(N_{j}\rightarrow N_{r}N_{s})\beta _{r}(p,k)\beta _{s}(k+1,q)}" loading="lazy"></span>
</p>
<div class="mw-heading mw-heading2"><h2 id="Computing_outside_probabilities">Computing outside probabilities</h2></div>
<p>Base Case:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha _{j}(1,n)={\begin{cases}1&amp;{\mbox{if }}j=1\\0&amp;{\mbox{otherwise}}\end{cases}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo>,</mo>
<mi>n</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow>
<mo>{</mo>
<mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false">
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mtext>if&nbsp;</mtext>
</mstyle>
</mrow>
<mi>j</mi>
<mo>=</mo>
<mn>1</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mtext>otherwise</mtext>
</mstyle>
</mrow>
</mtd>
</mtr>
</mtable>
<mo fence="true" stretchy="true" symmetric="true"></mo>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \alpha _{j}(1,n)={\begin{cases}1&amp;{\mbox{if }}j=1\\0&amp;{\mbox{otherwise}}\end{cases}}}</annotation>
</semantics>
</math></span><img src="./effbf8129bc86183569a1c03b4e95d9f69dba68c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:26.453ex; height:6.176ex;" alt="{\displaystyle \alpha _{j}(1,n)={\begin{cases}1&amp;{\mbox{if }}j=1\\0&amp;{\mbox{otherwise}}\end{cases}}}" loading="lazy"></span>
</p><p>Here the start symbol is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N_{1}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N_{1}}</annotation>
</semantics>
</math></span><img src="./71b670ae74954b8aacd4d720d9b2b2081f6d3869.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.92ex; height:2.509ex;" alt="{\displaystyle N_{1}}" loading="lazy"></span>.
</p><p>General case:
</p><p>Suppose there is a rule <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N_{r}\rightarrow N_{j}N_{s}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N_{r}\rightarrow N_{j}N_{s}}</annotation>
</semantics>
</math></span><img src="./6c27038b0c102a80eb9679744bcb15101672e4df.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:12.099ex; height:2.843ex;" alt="{\displaystyle N_{r}\rightarrow N_{j}N_{s}}" loading="lazy"></span> in the grammar that generates <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N_{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N_{j}}</annotation>
</semantics>
</math></span><img src="./e42efe207e17a74b4c17b1aa0cced7a84501bec9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:2.776ex; height:2.843ex;" alt="{\displaystyle N_{j}}" loading="lazy"></span>.
Then the <i>left</i> contribution of that rule to the outside probability <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha _{j}(p,q)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \alpha _{j}(p,q)}</annotation>
</semantics>
</math></span><img src="./691631b5f3d1213851f634b4d1b714bfae0cba2a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:7.48ex; height:3.009ex;" alt="{\displaystyle \alpha _{j}(p,q)}" loading="lazy"></span> is:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{k=q+1}^{k=n}P(N_{r}\rightarrow N_{j}N_{s})\alpha _{r}(p,k)\beta _{s}(q+1,k)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>q</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>n</mi>
</mrow>
</munderover>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">)</mo>
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>k</mi>
<mo stretchy="false">)</mo>
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>q</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
<mi>k</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sum _{k=q+1}^{k=n}P(N_{r}\rightarrow N_{j}N_{s})\alpha _{r}(p,k)\beta _{s}(q+1,k)}</annotation>
</semantics>
</math></span><img src="./be508988cbfb17783dc55a53400d11eacab2eaa1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:40.164ex; height:7.676ex;" alt="{\displaystyle \sum _{k=q+1}^{k=n}P(N_{r}\rightarrow N_{j}N_{s})\alpha _{r}(p,k)\beta _{s}(q+1,k)}" loading="lazy"></span>
</p><p>Now suppose there is a rule <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N_{r}\rightarrow N_{s}N_{j}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle N_{r}\rightarrow N_{s}N_{j}}</annotation>
</semantics>
</math></span><img src="./beda34806e44641fa4a52d5fa7ad92b05744a2e7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:12.099ex; height:2.843ex;" alt="{\displaystyle N_{r}\rightarrow N_{s}N_{j}}" loading="lazy"></span> in the grammar. Then the <i>right</i>
contribution of that rule to the outside probability <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha _{j}(p,q)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \alpha _{j}(p,q)}</annotation>
</semantics>
</math></span><img src="./691631b5f3d1213851f634b4d1b714bfae0cba2a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:7.48ex; height:3.009ex;" alt="{\displaystyle \alpha _{j}(p,q)}" loading="lazy"></span> is:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{k=1}^{k=p-1}P(N_{r}\rightarrow N_{s}N_{j})\alpha _{r}(k,q)\beta _{s}(k,p-1)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>p</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</munderover>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">)</mo>
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>k</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>k</mi>
<mo>,</mo>
<mi>p</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sum _{k=1}^{k=p-1}P(N_{r}\rightarrow N_{s}N_{j})\alpha _{r}(k,q)\beta _{s}(k,p-1)}</annotation>
</semantics>
</math></span><img src="./b7521bb33bbd2bab1164475b7f4066d9c5fb3c16.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:40.235ex; height:7.343ex;" alt="{\displaystyle \sum _{k=1}^{k=p-1}P(N_{r}\rightarrow N_{s}N_{j})\alpha _{r}(k,q)\beta _{s}(k,p-1)}" loading="lazy"></span>
</p><p>The outside probability <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha _{j}(p,q)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \alpha _{j}(p,q)}</annotation>
</semantics>
</math></span><img src="./691631b5f3d1213851f634b4d1b714bfae0cba2a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:7.48ex; height:3.009ex;" alt="{\displaystyle \alpha _{j}(p,q)}" loading="lazy"></span> is the sum of the left and right
contributions over all such rules:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha _{j}(p,q)=\sum _{N_{r},N_{s}}\sum _{k=q+1}^{k=n}P(N_{r}\rightarrow N_{j}N_{s})\alpha _{r}(p,k)\beta _{s}(q+1,k)+\sum _{N_{r},N_{s}}\sum _{k=1}^{k=p-1}P(N_{r}\rightarrow N_{s}N_{j})\alpha _{r}(k,q)\beta _{s}(k,p-1)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
</mrow>
</munder>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>q</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>n</mi>
</mrow>
</munderover>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">)</mo>
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>k</mi>
<mo stretchy="false">)</mo>
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>q</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
<mi>k</mi>
<mo stretchy="false">)</mo>
<mo>+</mo>
<munder>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
</mrow>
</munder>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mi>p</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</munderover>
<mi>P</mi>
<mo stretchy="false">(</mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<msub>
<mi>N</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">)</mo>
<msub>
<mi>α<!-- α --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>r</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>k</mi>
<mo>,</mo>
<mi>q</mi>
<mo stretchy="false">)</mo>
<msub>
<mi>β<!-- β --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>s</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>k</mi>
<mo>,</mo>
<mi>p</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \alpha _{j}(p,q)=\sum _{N_{r},N_{s}}\sum _{k=q+1}^{k=n}P(N_{r}\rightarrow N_{j}N_{s})\alpha _{r}(p,k)\beta _{s}(q+1,k)+\sum _{N_{r},N_{s}}\sum _{k=1}^{k=p-1}P(N_{r}\rightarrow N_{s}N_{j})\alpha _{r}(k,q)\beta _{s}(k,p-1)}</annotation>
</semantics>
</math></span><img src="./4d3bad2e9b9902012c9628c865da419305cdcd45.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:103.898ex; height:7.676ex;" alt="{\displaystyle \alpha _{j}(p,q)=\sum _{N_{r},N_{s}}\sum _{k=q+1}^{k=n}P(N_{r}\rightarrow N_{j}N_{s})\alpha _{r}(p,k)\beta _{s}(q+1,k)+\sum _{N_{r},N_{s}}\sum _{k=1}^{k=p-1}P(N_{r}\rightarrow N_{s}N_{j})\alpha _{r}(k,q)\beta _{s}(k,p-1)}" loading="lazy"></span>
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-manning-schuetze1999-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-manning-schuetze1999_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-manning-schuetze1999_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFManningHinrich_Schütze1999" class="citation book cs1">Manning, Christopher D.; Hinrich Schütze (1999). <span class="id-lock-limited" title="Free access subject to limited trial, subscription normally required"><a rel="nofollow" class="external text" href="https://archive.org/details/foundationsstati00mann_118"><i>Foundations of Statistical Natural Language Processing</i></a></span>. Cambridge, MA, USA: MIT Press. pp.&nbsp;<a rel="nofollow" class="external text" href="https://archive.org/details/foundationsstati00mann_118/page/n427">388</a>–402. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-262-13360-1</bdi>.</cite></span>
</li>
</ol></div></div>
<ul><li>J. Baker (1979): <a rel="nofollow" class="external text" href="https://asa.scitation.org/doi/abs/10.1121/1.2017061">Trainable grammars for speech recognition</a>. In J. J. Wolf and D. H. Klatt, editors, <i>Speech communication papers presented at the 97th meeting of the Acoustical Society of America</i>, pages 547–550, Cambridge, MA, June 1979. MIT.</li>
<li>Karim Lari, Steve J. Young (1990): <a rel="nofollow" class="external text" href="http://courses.cs.washington.edu/courses/cse599d1/16sp/lari-young-90.pdf">The estimation of stochastic context-free grammars using the inside–outside algorithm</a>. <i>Computer Speech and Language</i>, 4:35–56.</li>
<li>Karim Lari, Steve J. Young (1991): <a rel="nofollow" class="external text" href="https://www.sciencedirect.com/science/article/pii/088523089190009F">Applications of stochastic context-free grammars using the Inside–Outside algorithm</a>. <i>Computer Speech and Language</i>, 5:237–257.</li>
<li>Fernando Pereira, Yves Schabes (1992): <a rel="nofollow" class="external text" href="http://www.aclweb.org/anthology/P92-1017">Inside–outside reestimation from partially bracketed corpora</a>. <i>Proceedings of the 30th annual meeting on Association for Computational Linguistics, Association for Computational Linguistics</i>, 128–135.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="http://faculty.washington.edu/fxia/courses/LING572/inside-outside.ppt">Inside-outside algorithm - Fei Xia</a></li>
<li><a rel="nofollow" class="external text" href="http://www.cs.columbia.edu/~mcollins/io.pdf">The Inside-Outside Algorithm - Michael Collins</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2023-03-08" href="https://en.wikipedia.org/wiki/?title=Inside%E2%80%93outside_algorithm&amp;oldid=1143544206">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>